{% extends "admin/base_site.html" %}
{% load i18n grp_tags %} {# grp_csrf #}

{% block bodyclass %}grp-login{% endblock %}
{% block title %}{% if validlink %}{% trans 'Enter new password' %}{% else %}{% trans 'Password reset unsuccessful' %}{% endif %}{% endblock %}

{% block content %}
    <div class="g-d-c g-d-10 g-centered">
        {% if validlink %}
            <form action="" method="post">{% csrf_token %}
                <fieldset class="grp-module grp-module-login">
                    <h1>
                        <span class="grp-admin-title"><a href="{% url 'admin:index' %}">{% if grappelli_admin_title %}{{ grappelli_admin_title }}{% else %}{% get_admin_title %}{% endif %}</a></span>
                        <span class="grp-current-page">{% trans "Enter new password" %}</span>
                    </h1>
                    <div class="grp-module">
                        <div class="grp-row">
                            <p class="grp-description">{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
                        </div>
                        <div class="grp-row{% if form.new_password1.errors %} grp-errors{% endif %}">
                            <label for="id_new_password1" class="required">{% trans 'New password:' %}</label>
                            {{ form.new_password1 }}
                            {{ form.new_password1.errors }}
                        </div>
                        <div class="grp-row grp-connected{% if form.new_password2.errors %} grp-errors{% endif %}">
                            <label for="id_new_password2" class="required">{% trans 'Confirm password:' %}</label>
                            {{ form.new_password2 }}
                            {{ form.new_password2.errors }}
                            <p class="grp-help">{% trans 'Enter the same password as above, for verification.' %}</p>
                        </div>
                    </div>
                </fieldset>
                <div class="grp-module grp-submit-row">
                    <ul>
                        <li><input type="submit" value="{% trans 'Change my password' %}" class="grp-default" /></li>
                    </ul>
                </div>
            </form>
        {% else %}
            <div class="grp-module grp-module-login">
                <h1>
                    <span class="grp-admin-title"><a href="{% url 'admin:index' %}">{% if grappelli_admin_title %}{{ grappelli_admin_title }}{% else %}{% get_admin_title %}{% endif %}</a></span>
                    <span class="grp-current-page">{% trans 'Password reset unsuccessful' %}</span>
                </h1>
                <div class="grp-module">
                    <div class="grp-row">
                        <p class="grp-description">{% trans "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}</p>
                    </div>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}
